import NAV01 from '../../../assets/images/nav01.png'
import NAV02 from '../../../assets/images/nav02.png'
import NAV03 from '../../../assets/images/nav03.png'
import NAV04 from '../../../assets/images/nav04.png'
import NAV05 from '../../../assets/images/nav05.png'
import list01 from '../../../assets/images/list1.jpg'
import list02 from '../../../assets/images/list2.jpg'
import list03 from '../../../assets/images/list3.jpg'
import list04 from '../../../assets/images/list4.jpg'

import { GET_INDEX_LOOPIMG,GET_PROMOTION_PRODUCT } from '../actionTypes/index'
const defaultState = {
  swiperList: [],
  navs: [
    { id: 0, img: NAV01, text: '大聚会' },
    { id: 1, img: NAV02, text: '海外购' },
    { id: 2, img: NAV03, text: '超市百货' },
    { id: 3, img: NAV04, text: '厂家直销' },
    { id: 4, img: NAV05, text: '美食娱乐' },
  ],
  lists: [
    { id: 0, img: list01, text: '海绵包包' },
    { id: 1, img: list02, text: '韩国代购' },
    { id: 2, img: list03, text: 'ARC潮店' },
    { id: 3, img: list04, text: '欧力女装' },
  ],
  imgHeight: '10rem',
  promotionList: []
}
export default (state = defaultState, action) => {
  let newState = JSON.parse(JSON.stringify(state));
  switch (action.type) {
    case GET_INDEX_LOOPIMG:
      newState.swiperList = action.payload.swiperList;
      break;
    case GET_PROMOTION_PRODUCT:
      newState.promotionList = action.payload.promotionList;
      break;
    default:
      break;
  }
  return newState;
};
